package cate.common.table.task.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.table.d.GDTask;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("任务库")
public class TaskLibRow extends ERow {

    @NoteField(value = "历史事件类型")
    public int event;

    @NoteField(value = "事件参数")
    public int param;

    @NoteField(value = "任务名称")
    public String name;

    @NoteField(value = "持续时间类型")
    public byte duration;

    @NoteField(value = "目标值")
    public long value;

    @NoteField(value = "初始值")
    public long valueInit;

    @NoteField(value = "检测值")
    public byte checkType;

    @NoteField(value = "检测操作")
    public byte checkOper;

    public byte checkParam;

    @NoteField(value = "奖励")
    public String rewardStr;

    @NoteField(value = "是否公告")
    public boolean notice;
    @NoteField(value = "任务名称")
    public String noticeS1;
    @NoteField(value = "任务描述")
    public String noticeS2;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID", -1);
        this.event = xrw.getInteger("历史事件类型", 0);
        this.name = xrw.getString("任务名称");
        this.noticeS1 = xrw.getString("任务名称","");
        this.noticeS2 = xrw.getString("任务描述","");
        this.param = xrw.getInteger("事件参数", 0);
        this.duration = xrw.getByte("持续时间类型", GDTask.Duration.PERMANENT);
        this.value = xrw.getLong("目标值", 0L);
        this.valueInit = xrw.getLong("初始值", 0L);
        this.checkType = xrw.getByte("检测值", GDTask.CheckType.CUR);
        this.checkOper = xrw.getByte("检测操作", GDTask.CheckOper.GTE);
        this.checkParam = xrw.getByte("检测事件参数", GDTask.CheckOper.EQ);
        this.rewardStr = xrw.getString("奖励");
        this.notice = xrw.getBoolean("是否公告", false);
    }

    @Override
    public void decode() {

    }
}
